/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.tesoreria.be;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Gilmar
 */
@Entity
@Table(name = "tes_pagos_acotacion")
//@NamedQueries({@NamedQuery(name = "PagosAcotacion.findAll", query = "SELECT p FROM PagosAcotacion p"), @NamedQuery(name = "PagosAcotacion.findByPacCodigo", query = "SELECT p FROM PagosAcotacion p WHERE p.pacCodigo = :pacCodigo"), @NamedQuery(name = "PagosAcotacion.findByPacMonto", query = "SELECT p FROM PagosAcotacion p WHERE p.pacMonto = :pacMonto"), @NamedQuery(name = "PagosAcotacion.findByPacFecha", query = "SELECT p FROM PagosAcotacion p WHERE p.pacFecha = :pacFecha"), @NamedQuery(name = "PagosAcotacion.findByPacExpediente", query = "SELECT p FROM PagosAcotacion p WHERE p.pacExpediente = :pacExpediente")})
public class PagosAcotacion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "pac_codigo", nullable = false)
    private Integer pacCodigo;
    @Column(name = "pac_monto", precision = 11, scale = 4)
    private BigDecimal pacMonto;
    @Column(name = "pac_fecha")
    @Temporal(TemporalType.DATE)
    private Date pacFecha;
    @Column(name = "pac_expediente", length = 100)
    private String pacExpediente;
    @JoinColumn(name = "doc_codigo", referencedColumnName = "fk_doc_codigo")
    @ManyToOne(fetch = FetchType.LAZY)
    private DocumentoPago docCodigo;
    @JoinColumn(name = "dac_codigo", referencedColumnName = "dac_codigo")
    @ManyToOne(fetch = FetchType.LAZY)
    private DelegadoAcotacion dacCodigo;

    public PagosAcotacion() {
    }

    public PagosAcotacion(Integer pacCodigo) {
        this.pacCodigo = pacCodigo;
    }

    public Integer getPacCodigo() {
        return pacCodigo;
    }

    public void setPacCodigo(Integer pacCodigo) {
        this.pacCodigo = pacCodigo;
    }

    public BigDecimal getPacMonto() {
        return pacMonto;
    }

    public void setPacMonto(BigDecimal pacMonto) {
        this.pacMonto = pacMonto;
    }

    public Date getPacFecha() {
        return pacFecha;
    }

    public void setPacFecha(Date pacFecha) {
        this.pacFecha = pacFecha;
    }

    public String getPacExpediente() {
        return pacExpediente;
    }

    public void setPacExpediente(String pacExpediente) {
        this.pacExpediente = pacExpediente;
    }

    public DocumentoPago getDocCodigo() {
        return docCodigo;
    }

    public void setDocCodigo(DocumentoPago docCodigo) {
        this.docCodigo = docCodigo;
    }

    public DelegadoAcotacion getDacCodigo() {
        return dacCodigo;
    }

    public void setDacCodigo(DelegadoAcotacion dacCodigo) {
        this.dacCodigo = dacCodigo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pacCodigo != null ? pacCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PagosAcotacion)) {
            return false;
        }
        PagosAcotacion other = (PagosAcotacion) object;
        if ((this.pacCodigo == null && other.pacCodigo != null) || (this.pacCodigo != null && !this.pacCodigo.equals(other.pacCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cip.esymons.tesoreria.be.PagosAcotacion[pacCodigo=" + pacCodigo + "]";
    }

}
